Class HtmlRendererTest

java.lang.Object
com.fsf.news.renderer.HtmlRendererTest

@ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class) class HtmlRendererTest extends Object
Unit tests for the HtmlRenderer class.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) com.fsf.news.renderer.HtmlRenderer
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    Tests that the addElement method adds an element and returns the renderer instance.
    (package private) void
    Tests that the getElements method returns the expected elements when available.
    (package private) void
    Tests that the getElements method returns an empty list when no elements are available.
    (package private) void
    Tests that the render method returns an empty string when no elements are added.
    (package private) void
    Tests that the render method returns the expected HTML when an empty element is added.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • renderer

      @InjectMocks com.fsf.news.renderer.HtmlRenderer renderer
  • Constructor Details

    • HtmlRendererTest

      HtmlRendererTest()
  • Method Details

    • testGetElementsEmpty

      @Test void testGetElementsEmpty()
      Tests that the getElements method returns an empty list when no elements are available.
    • testGetElements

      @Test void testGetElements()
      Tests that the getElements method returns the expected elements when available.
    • testAddElement

      @Test void testAddElement()
      Tests that the addElement method adds an element and returns the renderer instance.
    • testRenderEmptyElement

      @Test void testRenderEmptyElement()
      Tests that the render method returns the expected HTML when an empty element is added.
    • testRenderEmpty

      @Test void testRenderEmpty()
      Tests that the render method returns an empty string when no elements are added.